package com.study.springsecurity.controller;

import com.study.springsecurity.pojo.Result;
import com.study.springsecurity.pojo.entity.RoleInfoEntity;
import com.study.springsecurity.service.RoleInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 平台管理接口
 * 访问限制：PLAT_ROLE角色可访问
 */
@Slf4j
@RestController
@RequestMapping("/role")
public class PlatRoleController {

    @Autowired
    private RoleInfoService roleInfoService;

    /**
     * 查询角色列表
     *
     * @return
     */
    @GetMapping("/queryRoleInfoList")
    public Result<List<RoleInfoEntity>> queryRoleInfoList() {
        return new Result<>(roleInfoService.list());
    }
}
